package org.zephyr.struct.decorator.ex;

import javax.swing.*;
import java.awt.*;

/**
 * 原身
 */
public class Original extends JFrame implements Morrigan {
    private static final long serialVersionUID=1L;
    private String imgUrl="1.png";

    public Original(){
        super("《恶魔战士》中的莫莉卡·安斯兰");
    }

    public void setImage(String imgUrl){
        this.imgUrl=imgUrl;
    }

    @Override
    public void display() {
        this.setLayout(new FlowLayout());
        JLabel label=new JLabel(new ImageIcon("src/main/java/org/zephyr/struct/decorator/ex/"+imgUrl));
        this.add(label);
        this.pack();
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }
}
